package io;

import java.util.Scanner;
import ioProcessor.OutputProcessor;

public class CommandIO {
	public static void process() {
		String cmd;
		Scanner in = new Scanner(System.in);
		while (true) {
			System.out.println("To get a schedule of a staff, please input \"S StaffID\":\n");
			System.out.println("To get a schedule of a room, please input \"R RoomID\":\n");
			System.out.println("To exit the program, please input \"E\"");
			cmd = in.nextLine();
			String[] cmds = cmd.split(" ",2);
			if (cmds[0].equalsIgnoreCase("S")) {
				OutputProcessor.processStaffSchedule(cmds[1]);
			}
			if (cmds[0].equalsIgnoreCase("R")) {
				OutputProcessor.processRoomSchedule(cmds[1]);
			}
			if (cmds[0].equalsIgnoreCase("E")) {
				System.out.println("Thank you for using the course arrangement system. The file \"Timetable.txt\" has been created to store all course data.");
				break;
			}
		}
	}
	
	public static void output(String s) {
		System.out.print(s);
	}
}
